//
// Created by wxd on 2025/7/27.
//

#include "PerspectiveCamera.h"

#include "glm/ext/matrix_clip_space.hpp"

PerspectiveCamera::PerspectiveCamera() {
    m_PerspectiveParams = {};
}

PerspectiveCamera::PerspectiveCamera(const float fov, const float aspect, const float near, const float far) {
    m_PerspectiveParams.fov = fov;
    m_PerspectiveParams.aspect = aspect;
    m_PerspectiveParams.zNear = near;
    m_PerspectiveParams.zFar = far;
}

PerspectiveCamera::~PerspectiveCamera() {

}

glm::mat4 PerspectiveCamera::getProjectMatrix() {
    m_ProjectMatrix = glm::perspective(glm::radians(m_PerspectiveParams.fov), m_PerspectiveParams.aspect,
        m_PerspectiveParams.zNear, m_PerspectiveParams.zFar);

    return m_ProjectMatrix;
}

void PerspectiveCamera::setPerspectiveParams(const PerspectiveParams &params) {
    m_PerspectiveParams = params;
}


